﻿using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq.Expressions;
using System.Reactive.Concurrency;

namespace System.Reactive.Linq
{
	public static partial class Qbservable
	{
		public static IQbservable<IList<TSource>> Buffer<TSource, TBufferClosing>(this IQbservable<TSource> source, Expression<Func<IObservable<TBufferClosing>>> bufferClosingSelector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(bufferClosingSelector != null, null, "bufferClosingSelector != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}

		public static IQbservable<IList<TSource>> Buffer<TSource>(this IQbservable<TSource> source, int count)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}

		public static IQbservable<IList<TSource>> Buffer<TSource>(this IQbservable<TSource> source, TimeSpan timeSpan)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}

		public static IQbservable<IList<TSource>> Buffer<TSource>(this IQbservable<TSource> source, int count, int skip)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}

		public static IQbservable<IList<TSource>> Buffer<TSource, TBufferOpening, TBufferClosing>(this IQbservable<TSource> source, IObservable<TBufferOpening> bufferOpenings, Expression<Func<TBufferOpening, IObservable<TBufferClosing>>> bufferClosingSelector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(bufferOpenings != null, null, "bufferOpenings != null");
			Contract.Requires(bufferClosingSelector != null, null, "bufferClosingSelector != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}

		public static IQbservable<IList<TSource>> Buffer<TSource>(this IQbservable<TSource> source, TimeSpan timeSpan, int count)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}

		public static IQbservable<IList<TSource>> Buffer<TSource>(this IQbservable<TSource> source, TimeSpan timeSpan, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}

		public static IQbservable<IList<TSource>> Buffer<TSource>(this IQbservable<TSource> source, TimeSpan timeSpan, TimeSpan timeShift)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}

		public static IQbservable<IList<TSource>> Buffer<TSource>(this IQbservable<TSource> source, TimeSpan timeSpan, int count, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}

		public static IQbservable<IList<TSource>> Buffer<TSource>(this IQbservable<TSource> source, TimeSpan timeSpan, TimeSpan timeShift, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}
	}
}